<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class CurrentChild extends Model
{
    //
    protected $fillable = ['user_id', 'child_id', 'device_code'];

    public function user(){
        return $this->belongsTo(User::class);
    }

    public function child(){
        return $this->belongsTo(Child::class);
    }

    public function device(){
        return $this->belongsTo(Device::class,'device_code', 'code');
    }
}
